<template>
  <div class="dyamic-manage">
    <div class="dyamic-manage-top">
      <div class="title bradius10 fs18 w165 h165 pl21 pt30 bg_line_blue"
           :style="{'background-image':'url('+dynamicStyle+')'}"
           @click="dynamic">
        <p class="fs19 fbold cfff">动态管理</span>
        <p class="fs16 cfff">more  >
          <!-- <img
            :src = "dynamicStyle"
          /> -->
        </p>
      </div>
      <div class="title bradius10 fs18 w165 h165 pl21 pt30 bg_line_green"
           :style="{'background-image':'url('+articlesStyle+')'}"
           @click="articles">
        <p class="fs20 fbold cfff">获客文章</p>
        <p class="fs16 cfff">more  >
          <!-- <img
           :src = "articlesStyle"
          /> -->
        </p>
      </div>
    </div>
    <div class="dyamic-manage-content">
      <div class="list" v-for="(item,k) in addTypes"
           :key="k"
           @click="choose_tap(item.type)">
          <p>{{item.name}}</p>
          <img :src="item.image">
      </div>
    </div>
    <!-- <div class="dyamic-manage-btn"></div> -->
  </div>
</template>
<script>
import imgBackUrl from '../../../utils/request.js'
export default {
  data(){
    return{
      addTypes:[
        {
           name: "发布动态",
           type: "dynamic",
           image:imgBackUrl.imgBackUrl+"/product-index/dynamic.png"},
        {
           name: "写原创文章",
           type: "article",
           image:imgBackUrl.imgBackUrl+"/product-index/original.png"},
        {
           name: "转载文章",
           type: "reprint",
           image:imgBackUrl.imgBackUrl+"/product-index/transpond.png",
         }
      ],
      dynamicStyle: imgBackUrl.imgBackUrl+'/product-index/img_news_l.png',
      articlesStyle: imgBackUrl.imgBackUrl+'/product-index/img_article_l.png',
    }
  },
  created() {

  },
  methods: {
    articles() {
      wx.navigateTo({
        url: "../shareRecord/main"
      });
    },
    dynamic() {
      wx.navigateTo({ url: "../dynamicControl/main" });
    },
    choose_tap(type){
      let isBoss = uni.getStorageSync('isBoss')
      // if(!isBoss){
      //   return false
      // }
      switch (type) {
        case "dynamic":
          wx.navigateTo({ url: "../dynamicIssue/main?type=dynamic" });
          break;
        case "article":
          //发布类型
           wx.navigateTo({ url: "../../editArticle/main" });
          break;
        case "reprint": //转载
          wx.navigateTo({ url: "../../editArticle/publicArticle" });
          break;

        // case "task": //任务管理
        //   // wx.navigateTo({ url: "../../createTask/main" });
        //   wx.navigateTo({ url: "../../marketing/marketingList/main" });
        //   break;

        case "cancel": //取消
          break;

        default:
          break;
      }
    }
  }
};
</script>
<style scoped>
 page{
   box-sizing: border-box;
 }
.dyamic-manage {
  background: #ffffff;
  box-sizing: border-box;
  padding: 30upx 30upx 0 30upx;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.dyamic-manage-top{
  display: flex;
  justify-content: space-between;

}
.title {
  background-size:100%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  box-shadow:0upx 0upx 20upx 10upx rgba(56,56,56,0.08);
}
.left-img {
  width: 12upx;
  height: 22upx;
}
.dyamic-manage-content{
  padding-top: 30upx;
  font-size:32upx;
  font-weight:bold;
  color:rgba(56,56,56,1);
  flex: 1;
}
.list{
  padding:0 58upx 0 61upx;
  height: 170upx;
  display: flex;
  justify-content: space-between;
  align-items:center;
  border-radius: 10upx;
  margin-bottom: 20upx;
  box-shadow: 0upx 0upx 20upx 0upx rgba(56,56,56,0.08);
}
.list image{
  width: 182upx;
  height: 70upx;
}
.dyamic-manage-btn{
  width: 100%;
  margin:0 auto;
  margin-bottom: 16upx;
  width: 268.2upx;
  height: 10upx;
  background: #A1A2A2;
  border-radius: 3upx;
}
</style>
